import axiosServer from '../utils/request'

/**
 * 登录接口
 * @param {*} username 
 * @param {*} password 
 * @returns 
 */
export const RequestMemberLogin = (username, password) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/login',
    data: {
      username,
      password
    }
  })
}
/**
 * 注册接口
 */
export const RequestonLogin = (formDate) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/reqister',
    data: formDate,
  })
}
/**
 * 修改个人信息
 */
export const xguserlist = (formDate) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/modify',
    data: formDate
  })
}
export const xguserlisttwo = (_id, nick, gender, telephone, mail, address) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/modifytwo',
    data: {
      _id,
      nick,
      gender,
      telephone,
      mail,
      address
    }
  })
}

// 获取小组件
export const getxiaolist = (_id) => {
  return axiosServer({
    method: 'get',
    url: '/api/user/xiaolist',
    params: { _id },
  })
}
// 修改组件列表
export const xiugaixiaolist = (_id, zujianlist) => {
  return axiosServer({
    method: 'post',
    url: '/api/user/xgxiaolist',
    data: { _id, zujianlist },
  })
}
